/*
 * Created on Jul 15, 2004
 *
 */
package littlecyberwar.control;

import littlecyberwar.util.*;
import java.util.*;
import littlecyberwar.ui.*;
import ModuleBuilder.model.*;
import littlecyberwar.control.net.*;
import littlecyberwar.model.*;

/**
 * @author Milton  Soong
 *
 * To change the template for this generated type comment go to
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
 */
public class GameStateControl {
	
	/**
	 * Go through the entire unit dictionary, and reset the movement distance 
	 * for all of them
	 *
	 */
	public static void resetAllDistanceMoved(ProfileCardPanel profileCardPanel) {
		Collection c = ElementIdDictionary.getAllUnits();
		Iterator it = c.iterator();
		while ( it.hasNext() ){
			Element el = (Element)it.next();
			UnitModel unit = el.getUnit();
			String attribName = Util._elementAttribDistanceMoved;
			unit.addHashValue(attribName, new Double(0.0));
		}
		// need to always reset the current displayed unit's distance moved,
		// no matter who it is
		profileCardPanel.resetDistanceAttribute();
	}
}
